package com.norra.base.api


import com.norra.base.BuildConfig
import com.norra.base.api.entity.*
import retrofit2.http.Body
import retrofit2.http.POST
import retrofit2.http.Path

/**
 * Created by Administrator on 2017/12/27.
 */

interface Api {

    companion object {
        const val BASE_URL = BuildConfig.BASE_URL
    }

    @get:POST("api/districts")
    val districts: MyCall<DistrictList>

    @POST("api/login")
    fun login(@Body request: LoginRequest): MyCall<LoginToken>

    @POST("api/register")
    fun register(@Body request: RegisterRequest): MyCall<BaseResponse>

    @POST("api/resetpwd")
    fun resetPassword(@Body request: ResetPwdRequest): MyCall<BaseResponse>

    @POST("api/setpwd")
    fun changePassword(@Body request: ChangePwdRequest): MyCall<BaseResponse>

    @POST("api/getdevbydistrict")
    fun getDeviceByDistrict(@Body request: DistrictDeviceRequest): MyCall<DeviceMaintainList>

    @POST("api/status/{deviceId}")
    fun getDeviceState(@Path("deviceId") deviceId: String): MyCall<BaseResponse>

    @POST("api/setcleanbin")
    fun cleanBin(@Body request: UpdateBinRequest): MyCall<BaseResponse>

    @POST("api/getmessage")
    fun getMsgList(@Body request: GetMsgRequest): MyCall<MsgList>

    @POST("api/setmessage")
    fun changeMsgState(@Body request: ChangeMsgRequest): MyCall<BaseResponse>

    @POST("api/setappmsgtoken")
    fun uploadFCMToken(@Body request: UploadFCMTokenRequest): MyCall<BaseResponse>

    @POST("api/getdstoverview")
    fun getOverview(@Body request: OverviewRequest): MyCall<DeviceOverview>

    @POST("api/setpercentage")
    fun setPercentage(@Body request: SetPercentageRequest): MyCall<BaseResponse>

    @POST("api/getpercentage")
    fun getPercentage(@Body request: DistrictRequest): MyCall<PercentageResponse>

    @POST("api/setdevnote")
    fun addNote(@Body request: AddNoteRequest): MyCall<BaseResponse>

    @POST("api/getdevnote")
    fun getNotes(@Body request: NoteRequest): MyCall<BinNote>

    @POST("api/setcleanbinsAndNote")
    fun repairAndNote(@Body request: RepairNoteRequest): MyCall<BaseResponse>

    @POST("api/getstatisicdailybydist")
    fun getDailyStatisic(@Body request: RepairNoteRequest): MyCall<BaseResponse>

    @POST("api/getdstCleanedTimes")
    fun getCleanedTimes(@Body request: CleanTimeRequest): MyCall<CleanTimeResponse>

    @POST("api/getdeviceInfo")
    fun getDeviceDetail(@Body request: BinRequest): MyCall<Maintain>

    @POST("api/getdstmaintain")
    fun getDeviceMaintain(@Body request: BinRequest): MyCall<MaintainResponse>

    @POST("api/getdevStatistic")
    fun getDeviceStatistic(@Body request: BinRequest): MyCall<BinStatisticResponse>

    @POST("api/getalldstbymail")
    fun sendMail(@Body request: MailRequest): MyCall<BaseResponse>

    @POST("api/generateSensorData")
    fun updateBinPercent(@Body request: UpdatePercentRequest): MyCall<BaseResponse>

    @POST("api/generateAshtrayData")
    fun updateAshtrayPercent(@Body request: UpdatePercentRequest): MyCall<BaseResponse>

    @POST("api/setDevAdminInfo")
    fun modifyBinInfo(@Body request: ModifyBinInfoRequest): MyCall<BaseResponse>

    @POST("api/appversion")
    fun getNewApk(@Body request: Map<String, String>): MyCall<ApkVersion>


    /** 新版APP接口  */

    @POST("api/register")
    fun getVerifyCode(@Body request: Map<String, String>): MyCall<BaseResponse>

    @POST("api/telVerify")
    fun verifyLogin(@Body request: Map<String, String>): MyCall<BaseResponse>



    @POST("api/addVillaDevice")
    fun addVillaDevice(@Body request: AddDeviceInfo): MyCall<BaseResponse>

    @POST("api/deviceVillaList")
    fun getMyDeviceList(): MyCall<DeviceResponse>

    /**
     * 参数
     * DevId="xxx"
     * Model="HouseHold"
     * Status=0/1
     */
    @POST("api/setVillaDev")
    fun setVillaDeviceStatus(@Body request: UpdateStatus): MyCall<BaseResponse>

    /**
     * 参数
     * DevId="xxx"
     */
    @POST("api/deleteVillaDev")
    fun deleteVillaDevice(@Body request: Map<String, String>): MyCall<BaseResponse>

}
